package com.mxchip.livestarmobile.mobile.util;


import com.mxchip.livestarmobile.mobile.Appli;
import com.mxchip.livestarmobile.R;

import java.util.HashMap;
import java.util.Map;

public class NetMap {
    static Map<Integer, String> txQuality = new HashMap<>();
    static Map<Integer, String> rxQuality = new HashMap<>();

    /*
    QUALITY_UNKNOWN(0)：质量未知
 QUALITY_EXCELLENT(1)：质量极好
 QUALITY_GOOD(2)：用户主观感觉和极好差不多，但码率可能略低于极好
 QUALITY_POOR(3)：用户主观感受有瑕疵但不影响沟通
 QUALITY_BAD(4)：勉强能沟通但不顺畅
 QUALITY_VBAD(5)：网络质量非常差，基本不能沟通
 QUALITY_DOWN(6)：网络连接断开，完全无法沟通
 QUALITY_UNSUPPORTED(7)：没有检测到网络上行
 QUALITY_DETECTING(8)：SDK 正在探测网络质量
 */
    static {
        txQuality.put(0, Appli.getContext().getString(R.string.unknown_quality));
        txQuality.put(1, Appli.getContext().getString(R.string.excellent_quality));
        txQuality.put(2, Appli.getContext().getString(R.string.good_quality));
        txQuality.put(3, Appli.getContext().getString(R.string.can_generally_communicate));
        txQuality.put(4, Appli.getContext().getString(R.string.not_smooth));
        txQuality.put(5, Appli.getContext().getString(R.string.basically_unable_communicate));
        txQuality.put(6, Appli.getContext().getString(R.string.totally_unable_communicate));
        txQuality.put(7, Appli.getContext().getString(R.string.not_checkout_net_downlink));
        txQuality.put(8, Appli.getContext().getString(R.string.detecting_network_quality));


        /*
        QUALITY_UNKNOWN(0)：质量未知
QUALITY_EXCELLENT(1)：质量极好
QUALITY_GOOD(2)：用户主观感觉和极好差不多，但码率可能略低于极好
QUALITY_POOR(3)：用户主观感受有瑕疵但不影响沟通
QUALITY_BAD(4)：勉强能沟通但不顺畅
QUALITY_VBAD(5)：网络质量非常差，基本不能沟通
QUALITY_DOWN(6)：网络连接断开，完全无法沟通
QUALITY_UNSUPPORTED(7)：没有检测到网络下行
QUALITY_DETECTING(8)：SDK 正在探测网络质量
*/
//        rxQuality.put(0, "质量未知");
//        rxQuality.put(1, "质量极好");
//        rxQuality.put(2, "用户主观感觉和极好差不多，但码率可能略低于极好");
//        rxQuality.put(3, "用户主观感受有瑕疵但不影响沟通");
//        rxQuality.put(4, "勉强能沟通但不顺畅");
//        rxQuality.put(5, "网络质量非常差，基本不能沟通");
//        rxQuality.put(6, "网络连接断开，完全无法沟通");
//        rxQuality.put(7, "没有检测到网络下行");
//        rxQuality.put(8, "SDK 正在探测网络质量");
        rxQuality.put(0, Appli.getContext().getString(R.string.unknown_quality));
        rxQuality.put(1, Appli.getContext().getString(R.string.excellent_quality));
        rxQuality.put(2, Appli.getContext().getString(R.string.good_quality));
        rxQuality.put(3, Appli.getContext().getString(R.string.can_generally_communicate));
        rxQuality.put(4, Appli.getContext().getString(R.string.not_smooth));
        rxQuality.put(5, Appli.getContext().getString(R.string.basically_unable_communicate));
        rxQuality.put(6, Appli.getContext().getString(R.string.totally_unable_communicate));
        rxQuality.put(7, Appli.getContext().getString(R.string.not_checkout_net_downlink));
        rxQuality.put(8, Appli.getContext().getString(R.string.detecting_network_quality));
    }

    public static String getTxQuality(int txInt) {
        return txQuality.get(txInt);
    }

    public static String getRxQuality(int rxInt) {
        return rxQuality.get(rxInt);
    }
}
